package com.heima.article.controller.v1;

import com.heima.article.service.ArticleCollectionService;
import com.heima.model.article.dtos.CollectionBehaviorDto;
import com.heima.model.common.dtos.ResponseResult;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 文章收藏接口
 */

@RestController
@Slf4j
@RequestMapping("/api/v1")
public class ArticleCollectionController {

    @Autowired
    private ArticleCollectionService articleCollectionService;

    /**
     * 处理文章收藏
     * @param dto
     * @return
     */
    @RequestMapping("/collection_behavior")
    public ResponseResult collection(@RequestBody CollectionBehaviorDto dto){
        return articleCollectionService.collection(dto);
    }
}